import pandas as pd

def signal(*args):  # 只接受两个参数：df 和 param
    df = args[0]
    n = args[1]
    factor_name = args[2]
    df[factor_name] = df['close'] / df['close'].rolling(n).mean() - 1
    return df